package com.rupertjones.globalcron.resources;

import org.brownflat.dbinit.upgrade.Upgrade;
import org.springframework.stereotype.Component;

/**
 * <p>&copy Rupert Jones 2011,2012</p>
 *
 * @author rup
 */
@Component
public class Upgrade0008CreateAdmin implements Upgrade {

    private static final int VERSION = 8;

    @Override
    public int getSequence() {
        return VERSION;
    }

    @Override
    public String getSql() {
        return "INSERT INTO user (id, username, password) VALUES (1,'admin','5f4dcc3b5aa765d61d8327deb882cf99');\n"
                + "INSERT INTO role (id, name) VALUES (1, 'ADMIN');\n"
                + "INSERT INTO user_role (user,role) VALUES (1,1);";
    }

    @Override
    public String getName() {
        return "Create admin user";
    }
}
